import request from '@/config/axios'

// 应急物资管理->出库单主表->出库单明细 VO
export interface ResInventoryOutDetailVO {
  id: number // 明细ID
  outOrderId: number // 出库单ID
  materialId: number // 物资ID
  inventoryId: number // 关联的库存记录ID
  plannedQuantity: number // 计划出库数量
  actualQuantity: number // 实际出库数量
  batchNo: string // 批次号
  expiryDate: Date // 过期日期
  unitPrice: number // 单价
  pickLocation: string // 拣货库位
  remark: string // 备注
}

// 应急物资管理->出库单主表->出库单明细 API
export const ResInventoryOutDetailApi = {
  // 查询应急物资管理->出库单主表->出库单明细分页
  getResInventoryOutDetailPage: async (params: any) => {
    return await request.get({ url: `/wms/res-inventory-out-detail/page`, params })
  },

  // 查询应急物资管理->出库单主表->出库单明细详情
  getResInventoryOutDetail: async (id: number) => {
    return await request.get({ url: `/wms/res-inventory-out-detail/get?id=${id}` })
  },

  // 新增应急物资管理->出库单主表->出库单明细
  createResInventoryOutDetail: async (data: ResInventoryOutDetailVO) => {
    return await request.post({ url: `/wms/res-inventory-out-detail/create`, data })
  },

  // 修改应急物资管理->出库单主表->出库单明细
  updateResInventoryOutDetail: async (data: ResInventoryOutDetailVO) => {
    return await request.put({ url: `/wms/res-inventory-out-detail/update`, data })
  },

  // 删除应急物资管理->出库单主表->出库单明细
  deleteResInventoryOutDetail: async (id: number) => {
    return await request.delete({ url: `/wms/res-inventory-out-detail/delete?id=${id}` })
  },

  // 导出应急物资管理->出库单主表->出库单明细 Excel
  exportResInventoryOutDetail: async (params) => {
    return await request.download({ url: `/wms/res-inventory-out-detail/export-excel`, params })
  },
}
